/*
 * @Author: 吴世扬 18368095041@163.com
 * @Date: 2025-02-13 10:20:49
 * @LastEditors: 吴世扬 18368095041@163.com
 * @LastEditTime: 2025-02-26 08:47:43
 * @FilePath: /vue3-admin-server/src/services/response.service.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { Injectable } from '@nestjs/common';

import { successRes, errorRes, unauthorizedRes } from 'src/common/utils';

@Injectable()
export class ResponseService {
    success<T>(msg?: string, data?: T): VO.ResultVO<T> {
        return successRes(msg, data);
    }

    error<T>(msg?: string, data?: T): VO.ResultVO<T> {
        return errorRes(msg, data);
    }

    unauthorized<T>(msg?: string, data?: T): VO.ResultVO<T> {
        return unauthorizedRes(msg, data);
    }
}
